#!/bin/bash

MODULE_NAME="test_misc"
WORK_DIR=$(cd .. && pwd)
echo ${WORK_DIR}
export KERNEL_CFLAGS="-I${WORK_DIR}/common"
cd ${WORK_DIR}/misc
make

dmesg -c > /dev/null 2>&1
test_kernel=$(lsmod | grep ${MODULE_NAME})
[ ! -z ${test_kernel} ] && rmmod ${MODULE_NAME}

insmod ${MODULE_NAME}.ko
echo -e "\n========================================"
./test_user
dmesg
